<extend name="Base/common"/>
<block name="header">
    <title>{$meta_title}</title>
</block>
<block name="body">
    <img style="padding-left:5px;padding-top: 5px" width="40px" onclick="history.go(-1)"
         src="__MAST_HOME__/picture/return.png">
    <a href="{:U('User/material')}">
        <img style="position: absolute;right: 5px;top: 5px" width="35px" src="__MAST_HOME__/picture/shouye.png">
    </a>
    <img width="100%" src="__MAST_HOME__/picture/top3.png">
    <center><span style="font-size: 30px" id="Money">0</span></center>
    <div style="margin-left: 60px ">
        <table class="txt1">
            <tr>
                <td>&emsp;
                    <input id="WMoney" placeholder="请输入提现金额" type="text"
                                 style="border: none;position: relative;top: 25px;background: none">
                </td>
            </tr>
        </table>
        <table class="txt2">
            <tr>
                <td>&emsp;&emsp;&emsp;1.00-50000.00</td>
            </tr>
        </table>
    </div>
    <br>
    <div class="qd">
        <table class="qdt1">
            <tr>
                <td>时间</td>
                <td>收入</td>
                <td>余额</td>
            </tr>
        </table>
    </div>
    <a id="hide" class="col-xs-12 text-center alert alert-danger " style="padding: 5px;">还没有记录</a>
    <div class="col-xs-12 text-center">
        <ul class="pagination">
            <li>
                <a href="##">首页</a>
            </li>
            <li>
                <a href="##">上一页</a>
            </li>
            <li>
                <a href="##" id="pa">1/3</a>
            </li>
            <li>
                <a href="##">下一页</a>
            </li>
            <li>
                <a href="##">末页</a>
            </li>
        </ul>
    </div>
    <img class="qdimg2" width="125px" src="__MAST_HOME__/picture/xyb2.png">
</block>
<!--<block name="side"></block>-->
<block name="script">
    <script>
        // localStorage.UId ='72B47CE4BB09BCD6';
        GetUserInfo();
        initLocation({
            sheng_val: "",
            shi_val: "",
        });
        //省份以及市区地址选择
        function sh1() {
            $("#Province").val($("#sheng").find("option:selected").text());
        }
        function shi1() {
            $("#City").val($("#shi").find("option:selected").text())
        }
        //个人信息验证
        function sub() {
            var URegex = /^1[34578][0-9]{9}$/;
            var User = $("#Tel").val();
            if (URegex.test(User) != true) {
                $("#hide").removeClass('hide');
                $("#hide").html('手机号码错误');
                timer();
                return false;
            }
            if ($("#UserRealName").val() == "" || $("#UserRealName").val() == null || $("#Tel").val() == "" || $("#BankName").val() == "" || $("#BankNum").val() == "" || $("#UserName").val() == "" || $("#Pass").val() == "") {
                $("#hide").removeClass('hide');
                $("#hide").html('输入不能为空');
                timer();
            } else {
                //数据传输
                $.post('', {
                    UId: localStorage.UId,
                    Tel: $("#Tel").val(), //手机
                    UserPass: $("#Pass").val(), //密码
                    UserRealName: $("#UserRealName").val(), //昵称
                    Sex: $("#sex").val(), //性别
                    Email: $("#Email").val(), //邮箱
                    BankName: $("#BankName").val(), //开户银行
                    BankNum: $("#BankNum").val(), //银行卡号
                    UserName: $("#UserName").val(), //开户姓名
                    Province: $("#Province").val(), //省
                    City: $("#City").val(),//市区
                    Town: $("#Town").val(),
                    IdCard: $("#IdCard").val(),//身份证
                }, function (ret) {
                    if (ret) {
                        if (ret.state == "1") {
                            var str = ret.msg;
                            $("#hide").removeClass('hide');
                            $("#hide").html('保存成功');
                            timer();
                            location.href = "usercenter.html";
                        } else {
                            $("#hide").removeClass('hide');
                            $("#hide").html(ret.msg);
                            timer();
                        }
                    } else {
                        $("#hide").removeClass('hide');
                        $("#hide").html('网络错误');
                    }
                })
            }
        }
        //提示信息显示时间
        function timer() {
            setTimeout(function () {
                $("#hide").addClass('hide');
            }, 2000)
        }
        function GetUserInfo() {
            $.post("", {
                        UId: localStorage.UId
                    },
                    function (ret) {
                        // alert(JSON.stringify(ret));
                        if (ret.state == "1") {
                            var data = ret.msg;
                            $("#Tel").val(data.Tel);
                            $("#UserRealName").val(data.UserRealName);
                            $("#BankName").val(data.BankName);
                            $("#BankNum").val(data.BankNum);
                            $("#UserName").val(data.UserName);
                            $("#Province").val(data.Province);
                            $("#City").val(data.City);
                            $("#IdCard").val(data.IdCard);
                            if (data.UserName == '' || data.UserName == null) {
                                $("#UserName").removeAttr("readonly");
                            }
                            if (data.IdCard == '' || data.IdCard == null) {
                                $("#IdCard").removeAttr("readonly");
                            }
                            if (data.UserRealName == '' || data.UserRealName == null) {
                                $("#UserRealName").removeAttr("readonly");
                            }


                        }
                    });
        }
    </script>
</block>
